package ch07_GUI编程;

import java.awt.Adjustable;

import javax.swing.JScrollBar;

public class JSrollBarDemo {
	public static void main(String[] args) {
		BaseFrame f = new BaseFrame("JScrollBar Demo");
		
		JScrollBar sb1 = new JScrollBar(Adjustable.HORIZONTAL);
		sb1.setValue(30);
		sb1.setLocation(5, 5);
		sb1.setSize(300, 30);
		
		JScrollBar sb2 = new JScrollBar(Adjustable.HORIZONTAL);
		sb2.setVisibleAmount(10);
		sb2.setMinimum(-10);
		sb2.setMaximum(20);
		sb2.setValue(10);
		sb2.setLocation(5, 85);
		sb2.setSize(300, 30);
		
		JScrollBar sb3 = new JScrollBar(Adjustable.VERTICAL,20,30,0,50);
		sb3.setBlockIncrement(10);
		sb3.setUnitIncrement(5);
		sb3.setLocation(350, 5);
		sb3.setSize(20, 110);
		
		f.add(sb1);
		f.add(sb2);
		f.add(sb3);
		
		f.showMe();
		
	}
}
